package plan;

import java.sql.SQLException;
import java.util.ArrayList;

import com.ibatis.sqlmap.client.SqlMapClient;

public class PlanDAO {
	public void insert(SqlMapClient sqlMap, Plan plan) throws SQLException {
		sqlMap.insert("plan.insert", plan);
	}
	public ArrayList<Plan> recent(SqlMapClient sqlMap, String id) throws SQLException {
		return (ArrayList<Plan>) sqlMap.queryForList("plan.recent", id);
	}
	public ArrayList<Plan> monthly(SqlMapClient sqlMap, Plan monthly) throws SQLException {
		return (ArrayList<Plan>) sqlMap.queryForList("plan.monthly", monthly);
	}
	public ArrayList<Plan> daily(SqlMapClient sqlMap, Plan daily) throws SQLException {
		return (ArrayList<Plan>) sqlMap.queryForList("plan.daily", daily);
	}
	public Plan select(SqlMapClient sqlMap, int num) throws SQLException {
		return (Plan) sqlMap.queryForObject("plan.select", num);
	}
	public void update(SqlMapClient sqlMap, Plan plan) throws SQLException {
		sqlMap.update("plan.update", plan);
	}
	public void delete(SqlMapClient sqlMap, int num) throws SQLException {
		sqlMap.delete("plan.delete", num);
	}
	public void deleteplan(SqlMapClient sqlMap, String id) throws SQLException {
		sqlMap.delete("plan.deleteplan", id);
	}
}
